package com.shihb.chapter07designpattern.decotator

/**
 * Description:
 *
 * @author shihb
 * @date 2020/10/4 11:09
 */
class Milk(drink: Drink) extends Decorator(drink) {

  override def description: Unit = {
    drink.description
    println("+"+name)
  }

  override def cost: Double = {
    println(name+"---"+price)
    price+drink.cost
  }

  override var name: String = "牛奶"
  override var price: Double = 5.0
}
